﻿using Business.Models;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace Business.EntityFrameworkCore
{
    [ConnectionStringName("Business")]
    public class BusinessDbContext : AbpDbContext<BusinessDbContext>
    {
        public DbSet<Book> Book { get; set; }

        public DbSet<Sale> Sale { get; set; }

        public DbSet<SaPro> SaPro { get; set; }
        public DbSet<Dstributor> Dstributor { get; set; }

        public DbSet<Inventory> Inventory { get; set; }

        public DbSet<Produce> Produce { get; set; }

        public DbSet<Purch> Purch { get; set; }

        public DbSet<Supplier> Supplier { get; set; }

        public DbSet<Pricing> Pricing { get; set; }

        public DbSet<AssembleInfo> AssembleInfo { get; set; }

        public DbSet<AssPro> AssPro { get; set; }


        public DbSet<PrintTemplate> PrintTemplate { get; set; }

        #region 入库出库新表
        /// <summary>
        /// 入库单
        /// </summary>
        public DbSet<AddWarehouse> AddWarehouse { get; set; }
        /// <summary>
        /// 入库明细表
        /// </summary>
        public DbSet<AddWarehouseList> AddWarehouseList { get; set; }
        /// <summary>
        /// 确认表
        /// </summary>
        public DbSet<AddConfirmForm> AddConfirmForm { get; set; }
        /// <summary>
        /// 仓库表
        /// </summary>
        public DbSet<Warehouses> Warehouses { get; set; }
        #endregion


        #region 借货还货

        public DbSet<BorrowM> BorrowM { get; set; }
        public DbSet<BorrowPro> BorrowPro { get; set; }
        public DbSet<CheckDetail> CheckDetail { get; set; }
        public DbSet<CheckPlan> CheckPlan { get; set; }

        public DbSet<CheckQ> CheckQ { get; set; }
        public DbSet<Deliverys> Deliverys { get; set; }

        public DbSet<GoodCom> GoodCom { get; set; }
        public DbSet<InDetail> InDetail { get; set; }
        public DbSet<Inven> Inven { get; set; }
        /// <summary>
        /// 换货表
        /// </summary>
        public DbSet<RGoods> RGoods { get; set; }
        public DbSet<RDetail> RDetail { get; set; }

        public DbSet<SendG> SendG { get; set; }

        public DbSet<SendInfo> SendInfo { get; set; }

        public DbSet<SendDetail> SendDetail { get; set; }

        #endregion





        #region  入库旧表（弃用）
        /// <summary>
        /// ����
        /// </summary>
        public DbSet<Storage> Storage { get; set; }
        /// <summary>
        /// ��ⵥ��ϸ
        /// </summary>
        public DbSet<StorageList> StorageList { get; set; }
        public DbSet<OutStorage> OutStorage { get; set; }
        public DbSet<OutStorageList> OutStorageList { get; set; }
        #endregion




        #region 产品相关
        public DbSet<Product> Product { get; set; }
        public DbSet<ProductsType> ProductsType { get; set; }
        public DbSet<ProductCuring> ProductCuring { get; set; }
        public DbSet<ProductDetails> ProductDetails { get; set; }
        #endregion


        #region 调拨

        public DbSet<Allocate> Allocate { get; set; }
        public DbSet<AllocationDetails> AllocationDetails { get; set; }






        public DbSet<DatabaseSum> DatabaseSum { get; set; }
        public DbSet<AllocationDesc> AllocationDesc { get; set; }
        public DbSet<PreciseLibrary> PreciseLibrary { get; set; }
        public DbSet<SumTransfers> SumTransfers { get; set; }
        #endregion


        //Code generation...
        public BusinessDbContext(DbContextOptions<BusinessDbContext> options)
            : base(options)
        {

        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.ConfigureBusiness();
        }
    }
}
